import deepcopy from "deepcopy";
import { defineComponent, inject, reactive,watch } from "vue";

export default defineComponent({
  props: {
    modelValue: Array,
    renders:Array
  },
  emits: ["update:modelValue"],
  setup(props, ctx) {  
    // console.log(789987,props.renders.value);
    //table初始值
    if(props.renders.value===undefined){
      props.renders.value=reactive([
        {
          id:'1',
          label:'项目1',
          value:''
        },
        {
          id:'2',
          label:'项目2',
          value:''
        }
      ])
    }
    
    return () => {
      return props.renders.value.map((item, index) => {
        return (
          <div class="editors-table">
            <div class="editors-table-item">
              <div class="editors-table-item-label">{item.label}</div>
              <div class="editors-table-item-value">{item.value}</div>
            </div>
          </div>
        );
      });
    };
  },
});
